home *** CD-ROM | disk | FTP | other *** search
- "---------------------------------------------------------------------"
- " MsgPort Class allows the User to communicate using MsgPorts, either "
- " within AmigaTalk programs, or to any defined MsgPort known to Exec. "
- ""
- " WARNING! WARNING! Danger, Will Robinson! "
- " You had better know what size & what Message any outside System "
- " MsgPort expects to see & respond to! "
- "---------------------------------------------------------------------"
-
- Class MsgPort :Object ! private portName !
- [
- killPort
- <primitive 191 0 private>.
- private <- nil "One-way ticket to death!"
- |
- addPort: msgSize priority: priority
- " Add the MsgPort to the AmigaOS System PortList. Use new: first! "
-
- (<primitive 191 1 private msgSize priority>)
-
- ifNil: [ self error: 'MsgPort ', portName, ' NOT added to System!'.
- ^ false
- ].
- ^ true
- |
- getMessage
- " If no message ever gets sent, you'll freeze AmigaTalk!! "
- ^ <primitive 191 2 private> "Return an array of bytes."
- |
- sendMessage: bytesArray
- <primitive 191 3 private bytesArray>
- |
- sendMessageOutsideTo: systemPortObj msg: bytesArray size: msgSize
- " Send a message to a MsgPort outside the AmigaTalk System.
- * WARNING! WARNING! Danger, Will Robinson!
- * You had better know what size & what Message the port expects!
- "
- <primitive 191 7 private systemPortObj bytesArray msgSize>
- |
- checkForPort
- " See if the MsgPort Object is known to the AmigaOS: "
- ^ <primtive 191 4 private> "Return either true or false."
- |
- getNamedSystemPort: sysPortName
- " Return an Integer that represents the System Port Name given: "
- ^ <primitive 191 5 sysPortName>
- |
- new: newPortName
- " Allocate & initialize a new MsgPort for AmigaTalk: "
- private <- <primitive 191 6 newPortName>.
- portName <- newPortName.
- ^ self
- |
- new
- " Maybe this should be: printClassUsedInError "
- ^ (self new: 'Default_AmigaTalk_MPort')
- ]
-